package tianrun.ziguan.api.calculate.config.config.exception;

public enum CommonErrorCode implements ErrorCode {

    SUCCESS("1000", "请求正常"),
    PARAM_MISTAKE("1001", "参数有误"),
    SYS_ERROR("1004", "系统异常"),
    SELECT_ERROR("10001", "查询数据失败"),
    DATA_SOURCE_ERROR("10002", "数据源不存在"),
    FILTER_FIELDS_ERROR("10003", "条件错误"),

    SYS_1022("1022", "请求方式错误"),
    SYS_1008("1008", "输入参数格式类型有误"),
    ;


    private final String code;
    private final String describe;

    CommonErrorCode(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getDescription() {
        return this.describe;
    }

    @Override
    public String toString() {
        return String.format("Code:[%s], Describe:[%s]", this.code, this.describe);
    }

}
